require("../../assets/css/index.less");
require("./sportsDetail.less");
require("../../assets/fonts_two/iconfont");
const dom = require("../../utils/dom");
const axios = require("axios");
const https = require('../../utils/https');
const { footer, color, $, $$, addEvent } = require("../../utils/dom");
import 'mui-player/dist/mui-player.min.css';
import MuiPlayer from 'mui-player';
axios.defaults.headers.common['Authorization'] = "Bearer " + JSON.parse
dom.ready(function() {
    https.get('/api/train/courseDetail?' + location.search.slice(1), res => {
        if (res.errno == 0) {
            // 初始化 MuiPlayer 插件，MuiPlayer 方法传递一个对象，该对象包括所有插件的配置
            var mp = new MuiPlayer({
                container: '#mui-player',
                title: res.data.fragments[0].title,
                src: `${https.BASE_URL}${res.data.fragments[0].videoUrl}`,
                poster: `${https.BASE_URL}${res.data.imgurl}`,
            });
        }
        console.log(res);
    });
    // 回退按钮
    addEvent('.back', () => {
        location.href = 'sportsPractice.html'
    })
});